package SeqGen;

import java.util.ArrayList;
import java.util.List;

public class SequenceUtil {

	/**
	 * returns a sublist of the input list minus the string defined in first
	 * parameter
	 * 
	 * @param str
	 * @param ltr
	 * @return
	 */
	//Method tested on input and working fine
	public static List<String> subList(int index,List<String> ltr)
	{
		
		List<String> var1 = new ArrayList<String>();
		List<String> var2 = new ArrayList<String>();
		List<String> var = new ArrayList<String>();
		
		
		int lstSize = ltr.size();
		if(index > 0 && index < (lstSize-1)){
			var1 = ltr.subList(0, (index));
			var2 = ltr.subList(index+1, lstSize);
			var.addAll(var1);
			var.addAll(var2);
		}
		else if(index == 0){
			var.addAll(ltr.subList(1, lstSize));
		}
		else if(index == (lstSize-1)){
			var.addAll(ltr.subList(0, (lstSize-1)));
		}
		
		return var;
	}
	

}
